<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="https://gmpg.org/xfn/11">
	<link href="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/favicon/favicon.png" rel="icon">
  <title>CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为 - Lixypro博客</title>

	<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">

	<!-- This site is optimized with the Yoast SEO plugin v16.1.1 - https://yoast.com/wordpress/plugins/seo/ -->
	<title>CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为 - Lixypro博客</title>
	<link rel="canonical" href="https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html">
	<meta property="og:locale" content="zh_CN">
	<meta property="og:type" content="article">
	<meta property="og:title" content="CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为 - Lixypro博客">
	<meta property="og:description" content="本文主要介绍一下CentOS7下fail2ban-0.9.4安装以及如何和iptab [&hellip;]">
	<meta property="og:url" content="https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html">
	<meta property="og:site_name" content="Lixypro博客">
	<meta property="article:published_time" content="2021-04-09T16:55:58+00:00">
	<meta name="twitter:card" content="summary_large_image">
	<meta name="twitter:label1" content="作者">
	<meta name="twitter:data1" content="administrator">
	<meta name="twitter:label2" content="预计阅读时间">
	<meta name="twitter:data2" content="6分">
	<script type="application/ld+json" class="yoast-schema-graph">{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://blog.lixypro.com/#website","url":"https://blog.lixypro.com/","name":"Lixypro博客","description":"技术分享|网页前端|后端运维|网络安全|日常记事","potentialAction":[{"@type":"SearchAction","target":"https://blog.lixypro.com/?s={search_term_string}","query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":"WebPage","@id":"https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html#webpage","url":"https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html","name":"CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为 - Lixypro博客","isPartOf":{"@id":"https://blog.lixypro.com/#website"},"datePublished":"2021-04-09T16:55:58+00:00","dateModified":"2021-04-09T16:55:58+00:00","author":{"@id":"https://blog.lixypro.com/#/schema/person/504c3e2a3d8a31f292936e7a2241373b"},"breadcrumb":{"@id":"https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html"]}]},{"@type":"BreadcrumbList","@id":"https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"item":{"@type":"WebPage","@id":"https://blog.lixypro.com/","url":"https://blog.lixypro.com/","name":"首页"}},{"@type":"ListItem","position":2,"item":{"@type":"WebPage","@id":"https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html","url":"https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html","name":"CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为"}}]},{"@type":"Person","@id":"https://blog.lixypro.com/#/schema/person/504c3e2a3d8a31f292936e7a2241373b","name":"administrator","image":{"@type":"ImageObject","@id":"https://blog.lixypro.com/#personlogo","inLanguage":"zh-CN","url":"https://secure.gravatar.com/avatar/957d4bcaf62a121072d884ad505a9b2a?s=96&d=mm&r=g","contentUrl":"https://secure.gravatar.com/avatar/957d4bcaf62a121072d884ad505a9b2a?s=96&d=mm&r=g","caption":"administrator"},"sameAs":["https://blog.lixypro.com"]}]}</script>
	<!-- / Yoast SEO plugin. -->


<link rel="stylesheet" id="toc-screen-css" href="https://blog.lixypro.com/wp-content/plugins/table-of-contents-plus/screen.min.css?ver=2002" type="text/css" media="all">
<link rel="stylesheet" id="Katex-css" href="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/KaTeX/katex.min.css?ver=10.2.1" type="text/css" media="all">
<link rel="stylesheet" id="prism-theme-style-css" href="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/themes/prism-okaidia.css?ver=1.15.0" type="text/css" media="all">
<link rel="stylesheet" id="prism-plugin-toolbar-css" href="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/toolbar/prism-toolbar.css?ver=1.15.0" type="text/css" media="all">
<link rel="stylesheet" id="prism-plugin-line-numbers-css" href="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/line-numbers/prism-line-numbers.css?ver=1.15.0" type="text/css" media="all">
<link rel="stylesheet" id="external-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/external.css?ver=7.1.0" type="text/css" media="all">
<link rel="stylesheet" id="sweetalert2-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/sweetalert2.min.css?ver=7.1.0" type="text/css" media="all">
<link rel="stylesheet" id="app-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/app.css?ver=7.1.0" type="text/css" media="all">
<link rel="stylesheet" id="diy-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/diy.css?ver=7.1.0" type="text/css" media="all">
<link rel="stylesheet" id="fancybox-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/jquery.fancybox.min.css?ver=7.1.0" type="text/css" media="all">
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/jquery-2.2.4.min.js?ver=2.2.4" id="jquery-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/plugins/sweetalert2.min.js?ver=7.1.0" id="sweetalert2-js"></script>
		<script>
			document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );
		</script>
				<style>.no-js img.lazyload { display: none; }
			figure.wp-block-image img.lazyloading { min-width: 150px; }
							.lazyload, .lazyloading { opacity: 0; }
				.lazyloaded {
					opacity: 1;
					transition: opacity 400ms;
					transition-delay: 0ms;
				}</style>
			<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
      <script src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/html5shiv.js"></script>
      <script src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/respond.min.js"></script>
    <![endif]-->
          <script> $(document).ready(function() { NProgress.start(); $(window).load(function() { NProgress.done(); }); });</script>
    </head>

<body class="post-template-default single single-post postid-24 single-format-standard  max_width navbar-sticky navbar-full navbar-slide no-search sidebar-none pagination-numeric no-off-canvas">

<div class="site">
    
<header class="site-header">
      <div class="navbar">
      <div class="logo-wrapper">
              <a href="https://blog.lixypro.com/">
          <img data-dark="" alt="Lixypro博客" data-src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" class="logo regular tap-logo lazyload" src=""><noscript><img class="logo regular tap-logo" src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" data-dark="" alt="Lixypro博客"></noscript>
        </a>
            </div>
      <div class="sep"></div>
      
      <nav class="main-menu hidden-xs hidden-sm hidden-md">
        <ul id="menu-menu-1" class="nav-list u-plain-list">
<li id="menu-item-12" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-12"><a href="https://blog.lixypro.com/">本站首页</a></li>
<li id="menu-item-15" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-15"><a href="https://blog.lixypro.com/tags">标签集合</a></li>
<li id="menu-item-18" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-18"><a href="https://blog.lixypro.com/qianduansixiang">前端思想</a></li>
<li id="menu-item-19" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-19"><a href="https://blog.lixypro.com/houduanyunwei">后端运维</a></li>
<li id="menu-item-20" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20"><a href="https://blog.lixypro.com/zaixianfuwu">在线服务</a></li>
<li id="menu-item-21" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21"><a href="https://blog.lixypro.com/diannaojichu">电脑基础</a></li>
<li id="menu-item-22" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22"><a href="https://blog.lixypro.com/kejizixun">科技资讯</a></li>
<li id="menu-item-23" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-23"><a href="https://blog.lixypro.com/wangluoanquan">网络安全</a></li>
</ul>      </nav>
      
      <div class="main-search">
        <form method="get" class="search-form inline" action="https://blog.lixypro.com/">
  <input type="search" class="search-field inline-field" placeholder="输入关键词，回车..." autocomplete="off" value="" name="s" required="required">
  <button type="submit" class="search-submit"><i class="mdi mdi-magnify"></i></button>
</form>        <div class="search-close navbar-button"><i class="mdi mdi-close"></i></div>
      </div>

      <div class="actions">
                <!-- user end -->
        <div class="search-open navbar-button"><i class="mdi mdi-magnify"></i></div>
                <div class="burger"></div>
      </div>
    </div>
  </header>

<div class="header-gap"></div>    
    <div class="site-content">
    

<div class="container">
	<div class="breadcrumbs">
	当前位置：<a href="https://blog.lixypro.com/">Lixypro博客</a> <small>></small> <a href="https://blog.lixypro.com/houduanyunwei">后端运维</a> <small>></small> CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="content-area">
				<main class="site-main">
					<article id="post-24" class="article-content">
    <div class="container">
  
<div class="cao_entry_header">

  <header class="entry-header">    
    <h1 class="entry-title">CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为</h1>  </header>
</div>
</div>  <div class="container">
    <div class="entry-wrapper">
            <div class="entry-content u-text-format u-clearfix">
        <p>本文主要介绍一下CentOS7下fail2ban-0.9.4安装以及如何和iptables联动来阻止恶意扫描和密码猜测等恶意攻击行为。<br>
从CentOS7开始，官方的标准防火墙设置软件从iptables变更为firewalld。 为了使fail2ban-0.9.4与iptables联动，需禁用自带的firewalld服务，同时安装iptables服务。</p>
<h2>关于fail2ban-0.9.4</h2>
<ul>
<li>fail2ban-0.9.4可以监视你的系统日志，然后匹配日志的错误信息（正则式匹配）执行相应的屏蔽动作（一般情况下是调用防火墙屏蔽），如:当有人在试探你的HTTP、SSH、SMTP、FTP密码，只要达到你预设的次数，fail2ban就会调用防火墙屏蔽这个IP，而且可以发送e-mail通知系统管理员，是一款很实用、很强大的软件！
</li>
<li>
<p>fail2ban-0.9.4由python语言开发，基于logwatch、gamin、iptables、tcp-wrapper、shorewall等。如果想要发送邮件通知道，那还需要安装postfix或sendmail。</p>
</li>
<li>
<p>在外网环境下，有很多的恶意扫描和密码猜测等恶意攻击行为，使用fail2ban-0.9.4配合iptables，实现动态防火墙是一个很好的解决方案。</p>
</li>
</ul>
<h2>安装fail2ban-0.9.4</h2>
<p>首先需要到Fail2ban官网下载程序源码包，本文中通过稳定版fail2ban-0.9.4做演示，<a class="wp-editor-md-post-content-link" href="http://www.fail2ban.org/wiki/index.php/Main_Page">官网</a>，<a class="wp-editor-md-post-content-link" href="https://github.com/fail2ban/fail2ban/archive/0.9.4.tar.gz">0.9.4源码包</a></p>
<p><code>wget https://github.com/fail2ban/fail2ban/archive/0.9.4.tar.gz</code></p>
<p>下载完成之后，将它移动到<code>/usr/local/src</code>，然后再进行解压，这样子便于以后管理；</p>
<pre><code class="language-cmd line-numbers">[root@lixy src]# ls -la
总用量 332
drwxr-xr-x.  3 root root     57 2月  20 14:18 .
drwxr-xr-x. 12 root root    131 2月  15 14:52 ..
-rw-r--r--.  1 root root 335532 2月  20 14:17 fail2ban-0.9.4.tar.gz
[root@lixy src]# pwd
/usr/local/src
[root@lixy src]# tar -zxvf ./fail2ban-0.9.4.tar.gz 
</code></pre>
<p>解压完成之后就是安装了，由python语言开发，所以安装时需要：<code>python setup.py install</code></p>
<pre><code class="language-cmd line-numbers">[root@lixy src]# cd ./fail2ban-0.9.4
[root@lixy fail2ban-0.9.4]# ls
bin              COPYING   fail2ban-2to3                   FILTERS      MANIFEST.in     setup.cfg  Vagrantfile
ChangeLog        DEVELOP   fail2ban-testcases-all          kill-server  README.md       setup.py
config           doc       fail2ban-testcases-all-python3  man          README.Solaris  THANKS
CONTRIBUTING.md  fail2ban  files                           MANIFEST     RELEASE         TODO
[root@lixy fail2ban-0.9.4]# python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/fail2ban
copying fail2ban/__init__.py -&gt; build/lib/fail2ban
copying fail2ban/exceptions.py -&gt; build/lib/fail2ban
copying fail2ban/helpers.py -&gt; build/lib/fail2ban
copying fail2ban/protocol.py -&gt; build/lib/fail2ban
copying fail2ban/version.py -&gt; build/lib/fail2ban
creating build/lib/fail2ban/client
copying fail2ban/client/__init__.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/actionreader.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/beautifier.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/configparserinc.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/configreader.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/configurator.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/csocket.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/fail2banreader.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/fail2banregex.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/filterreader.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/jailreader.py -&gt; build/lib/fail2ban/client
copying fail2ban/client/jailsreader.py -&gt; build/lib/fail2ban/client
creating build/lib/fail2ban/server
copying fail2ban/server/__init__.py -&gt; build/lib/fail2ban/server
copying fail2ban/server/action.py -&gt; build/lib/fail2ban/server
copying fail2ban/server/actions.py -&gt; build/lib/fail2ban/server
copying fail2ban/server/asyncserver.py -&gt; build/lib/fail2ban/server
copying fail2ban/server/banmanager.py -&gt; build/lib/fail2ban/server
copying fail2ban/server/database.py -&gt; build/lib/fail2ban/server
copying fail2ban/server/datedetector.py -&gt; build/lib/fail2ban/server
------省略------
creating /var/lib/fail2ban
creating /usr/share/doc/fail2ban
copying README.md -&gt; /usr/share/doc/fail2ban
copying README.Solaris -&gt; /usr/share/doc/fail2ban
copying DEVELOP -&gt; /usr/share/doc/fail2ban
copying FILTERS -&gt; /usr/share/doc/fail2ban
copying doc/run-rootless.txt -&gt; /usr/share/doc/fail2ban
creating /run/fail2ban
running install_egg_info
Writing /usr/lib/python2.7/site-packages/fail2ban-0.9.4-py2.7.egg-info

Please do not forget to update your configuration files.
They are in /etc/fail2ban/.

[root@lixy fail2ban-0.9.4]# 
</code></pre>
<h3>手动生成一下程序的启动脚本</h3>
<p>安装完成后要手动生成一下程序的启动脚本。启动脚本位于目录：<code>/usr/local/src/fail2ban-0.9.4/files</code></p>
<pre><code class="language-cmd line-numbers">[root@lixy fail2ban-0.9.4]# cd /usr/local/src/fail2ban-0.9.4/files
[root@lixy files]# ls
bash-completion  debian-initd        fail2ban.service        fail2ban.upstart  gentoo-confd  ipmasq-ZZZzzz_fail2ban.rul  macosx-initd  nagios        solaris-fail2ban.xml  suse-initd
cacti            fail2ban-logrotate  fail2ban-tmpfiles.conf  gen_badbots       gentoo-initd  logwatch                    monit         redhat-initd  solaris-svc-fail2ban
[root@lixy files]# pwd
/usr/local/src/fail2ban-0.9.4/files
[root@lixy files]#
</code></pre>
<p>可以看到由官方制作的启动脚本非常之多，我们要对应版本，我的是：<code>redhat-initd</code></p>
<pre><code class="language-cmd line-numbers">cp /usr/local/src/fail2ban-0.9.4/files/redhat-initd /etc/init.d/fail2ban
chkconfig --add fail2ban
</code></pre>
<p>使用下列命令检查Fail2ban是否加入开机启动项。结果如下所示；</p>
<pre><code class="language-cmd line-numbers">[root@lixy files]# cp ./redhat-initd /etc/init.d/fail2ban
[root@lixy files]# chkconfig --add fail2ban
[root@lixy files]# chkconfig --list fail2ban

注：该输出结果只显示 SysV 服务，并不包含
原生 systemd 服务。SysV 配置数据
可能被原生 systemd 配置覆盖。 

      要列出 systemd 服务，请执行 'systemctl list-unit-files'。
      查看在具体 target 启用的服务请执行
      'systemctl list-dependencies [target]'。

fail2ban        0:关 1:关 2:关 3:开 4:开 5:开 6:关
[root@lixy files]# 
</code></pre>
<h3>程序文件</h3>
<p>安装完成后程序文件都是保存在/etc/fail2ban目录下，目录结构如下所示；<br>
其中<code>jail.conf</code>为主配置文件，相关的正则匹配规则位于<code>filter.d</code>目录，其它目录/文件一般很少用到，如果需要详细了解可自行搜索。</p>
<pre><code class="language-cmd line-numbers">[root@lixy ~]# cd /etc/fail2ban/
[root@lixy fail2ban]# ls -la
总用量 72
drwxr-xr-x.  6 root root   258 2月  20 14:19 .
drwxr-xr-x. 75 root root  8192 2月  20 14:19 ..
drwxr-xr-x.  2 root root  4096 2月  20 14:19 action.d
-rw-rw-r--.  1 root root  2328 3月   8 2016 fail2ban.conf
drwxr-xr-x.  2 root root     6 2月  20 14:19 fail2ban.d
drwxr-xr-x.  3 root root  4096 2月  20 14:19 filter.d
-rw-rw-r--.  1 root root 20839 3月   8 2016 jail.conf
drwxr-xr-x.  2 root root     6 2月  20 14:19 jail.d
-rw-rw-r--.  1 root root  2361 3月   8 2016 paths-common.conf
-rw-rw-r--.  1 root root   642 3月   8 2016 paths-debian.conf
-rw-rw-r--.  1 root root  1059 3月   8 2016 paths-fedora.conf
-rw-rw-r--.  1 root root  1174 3月   8 2016 paths-freebsd.conf
-rw-rw-r--.  1 root root   659 3月   8 2016 paths-opensuse.conf
-rw-rw-r--.  1 root root   290 3月   8 2016 paths-osx.conf
[root@lixy fail2ban]# 

</code></pre>
<p><strong>主要文件的作用解说</strong></p>
<pre><code class="language-cmd line-numbers">/etc/fail2ban/action.d            #动作文件夹，内含默认文件。iptables以及mail等动作配置
/etc/fail2ban/fail2ban.conf        #定义了fai2ban日志级别、日志位置及sock文件位置
/etc/fail2ban/filter.d            #条件文件夹，内含默认文件。过滤日志关键内容设置
/etc/fail2ban/jail.conf            #主要配置文件，模块化。主要设置启用ban动作的服务及动作阀值
/etc/rc.d/init.d/fail2ban          #启动脚本文件
</code></pre>
<h3>Fail2ban常用命令</h3>
<p>启动Fail2ban。</p>
<pre><code class="language-cmd line-numbers">systemctl start fail2ban

</code></pre>
<p>停止Fail2ban。</p>
<pre><code class="language-cmd line-numbers">systemctl stop fail2ban

</code></pre>
<p>开机启动Fail2ban。</p>
<pre><code class="language-cmd line-numbers">systemctl enable fail2ban

</code></pre>
<p>查看被ban IP，其中ssh-iptables为名称，比如上面的&#91;ssh-iptables&#93;和&#91;nginx-dir-scan&#93;。</p>
<pre><code class="language-cmd line-numbers">fail2ban-client status ssh-iptables

</code></pre>
<p>添加白名单。</p>
<pre><code class="language-cmd line-numbers">fail2ban-client set ssh-iptables addignoreip IP地址 

</code></pre>
<p>删除白名单。</p>
<pre><code class="language-cmd line-numbers">fail2ban-client set ssh-iptables delignoreip IP地址

</code></pre>
<p>查看被禁止的IP地址。</p>
<pre><code class="language-cmd line-numbers">iptables -L -n
</code></pre>
<h2>防御实例</h2>
<p>Linux 上Fail2ban阻止SSH暴力攻击 保护你的服务器不被暴力破解<br>
现在你已经准备好了通过配置 <code>fail2ban</code>来加强你的SSH服务器。你需要编辑其配置文件 <code>/etc/fail2ban/jail.conf</code>。 在配置文件的“<code>[DEFAULT]</code>”区，你可以在此定义所有受监控的服务的默认参数，另外在特定服务的配置部分，你可以为每个服务（例如SSH，Apache等）设置特定的配置来覆盖默认的参数配置。<br>
在针对服务的监狱区（在<code>[DEFAULT]</code>区后面的地方），你需要定义一个<code>[ssh-iptables]</code>区，这里用来定义SSH相关的监狱配置。真正的禁止IP地址的操作是通过iptables完成的。<br>
下面是一个包含<code>ssh-iptables</code>监狱配置的<code>/etc/fail2ban/jail.conf</code>的文件样例。当然根据你的需要，你也可以指定其他的应用监狱。</p>
<pre><code class="language-cmd line-numbers">[DEFAULT]
# 忽略的IP列表,不受设置限制
ignoreip = 127.0.0.1/8 

# 被封IP禁止访问的时间，单位是秒
bantime = 86400

# 检测时间，在此时间内超过规定的次数会激活fail2ban，单位是秒 
findtime = 300

# 允许错误登录的最大次数
maxretry = 3

# 日志修改检测机制（gamin、polling和auto这三种）
backend = auto 

# 定义日志级别，默认
loglevel = 3 

# 定义 fail2ban 日志文件
logtarget = /var/log/fail2ban.log 

# sock 文件存放位置，默认
socket = /var/run/fail2ban/fail2ban.sock 

# pid 文件存放位置，默认
pidfile = /var/run/fail2ban/fail2ban.pid 

# 邮件通知参数
sendmail-whois[name=SSH, dest=you@example.com, sender=fail2ban@example.com, sendername="Fail2Ban"]
                          ## 收件人地址           ## 发件人地址 

[sshd]
# 激活
enabled = true
# 规律规则名，对应filter.d目录下的sshd.conf
filter = sshd 
banaction = firewallcmd-new
# 检测的系统的登陆日志文件。这里要写sshd服务日志文件
logpath = /var/log/secure 
# 禁止用户IP访问主机1小时
bantime = 3600 
# 在5分钟内内出现规定次数就开始工作
findtime = 300 
# 3次密码验证失败
maxretry = 3 

[sshd-ddos]
enabled = true
port = 8888
</code></pre>
<p><strong>apache防攻击规则</strong></p>
<pre><code class="language-cmd line-numbers">[apache-tcpwrapper]
enabled  = true
filter  = apache-auth
action   = hostsdeny
logpath  = /var/log/httpd/error_log
maxretry = 6
[apache-badbots]
enabled  = true
filter   = apache-badbots
action   = iptables-multiport[name=BadBots, port="http,https"]
           sendmail-buffered[name=BadBots, lines=5, dest=you@example.com]
logpath  = /var/log/httpd/access_log
bantime  = 172800
maxretry = 1
[apache-shorewall]
enabled  = true
filter   = apache-noscript
action   = shorewall
           sendmail[name=Postfix, dest=you@example.com]
logpath  = /var/log/httpd/error_log
</code></pre>
<p><strong>nginx防攻击规则</strong></p>
<pre><code class="language-cmd line-numbers">[nginx-http-auth]
enabled = true
filter  = nginx-http-auth
action  = iptables-multiport[name=nginx-http-auth,port="80,443"]
logpath = /var/log/nginx/error.log
</code></pre>
<p><strong>lighttpd防规击规则</strong></p>
<pre><code class="language-cmd line-numbers">[suhosin]
enabled  = true
filter   = suhosin
action   = iptables-multiport[name=suhosin, port="http,https"]
# adapt the following two items as needed
logpath  = /var/log/lighttpd/error.log
maxretry = 2
[lighttpd-auth]
enabled  = true
filter   = lighttpd-auth
action   = iptables-multiport[name=lighttpd-auth, port="http,https"]
# adapt the following two items as needed
logpath  = /var/log/lighttpd/error.log
maxretry = 2
</code></pre>
      </div>
      <div id="pay-single-box"></div>
          <div class="entry-tags">
          <a href="https://blog.lixypro.com/tag/centos" rel="tag">
        Centos      </a>
          <a href="https://blog.lixypro.com/tag/fail2ban" rel="tag">
        fail2ban      </a>
          <a href="https://blog.lixypro.com/tag/%e5%ae%89%e5%85%a8" rel="tag">
        安全      </a>
      </div>
<div class="article-copyright">RIPRO主题是一个优秀的主题，极致后台体验，无插件，集成会员系统<br><a href="https://blog.lixypro.com/">Lixypro博客</a> &raquo; <a href="https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html">CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为</a>
</div>

<div class="article-footer">
    <div class="author-box">
    <div class="author-image">
      <img alt="administrator" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/avatar/1.png" class="lazyload avatar avatar-140 photo " height="140" width="140">    </div>
    <div class="author-info">
      <h4 class="author-name">
        <a target="_blank" href="javascript:;">administrator</a>
        <span class="label label-default"><i class="fa fa-diamond"></i> 普通</span>      </h4>
    </div>
  </div>
      <div class="xshare">
      <span class="xshare-title">分享到：</span>
            <a etap="share" data-share="qq" class="share-qq"><i class="fa fa-qq"></i></a>
      <a etap="share" data-share="weibo" class="share-weibo"><i class="fa fa-weibo"></i></a>
              <a href="javascript:;" class="btn-bigger-cover share-weixin" data-nonce="66db42e849" data-id="24" data-action="create-bigger-image" id="bigger-cover"><i class="fa fa-paper-plane"></i></a>
        </div>
   
</div>    </div>
  </div>
</article>


  <div class="entry-navigation">
    <nav class="article-nav">
        <span class="article-nav-prev">上一篇<br><a href="https://blog.lixypro.com/pingmiansheji/hello-world.html" rel="prev">世界，您好！</a></span>
        <span class="article-nav-next">下一篇<br><a href="https://blog.lixypro.com/houduanyunwei/detailed_explanation_of_the_process_of_compiling_and_installing_apache_on_centos_server_source_package.html" rel="next">Centos服务器源码包编译安装Apache过程详解</a></span>
    </nav>
    
  </div>

      <!-- # 标准网格模式... -->
      <div class="related-posts-grid">
        <h4 class="u-border-title">相关推荐</h4>
        <div class="row">
                     <div class="col-6 col-sm-3 col-md-3 mt-10 mb-10">
              <article class="post">
                  <div class="entry-media">
    <div class="placeholder" style="padding-bottom: 66.666666666667%;">
      <a target="_blank" href="https://blog.lixypro.com/houduanyunwei/the_role_of_configure_make_make_install.html">
        <img class="lazyload" data-src="https://blog.lixypro.com/wp-content/themes/ripro/timthumb.php?src=https://blog.lixypro.com/wp-content/themes/ripro/assets/images/thumb/1.jpg&#038;h=200&#038;w=300&#038;zc=1&#038;a=c&#038;q=100&#038;s=1" src="" alt="configure,make,make install的作用">  
      </a>
            <div class="cao-cover">
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript><img src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" width="50" height="50px"></noscript>
</noscript>
</noscript>
</noscript>
</div>
          </div>
      </div>
                  <div class="entry-wrapper">
                  
  <header class="entry-header">    
    <h4 class="entry-title"><a target="_blank" href="https://blog.lixypro.com/houduanyunwei/the_role_of_configure_make_make_install.html" title="configure,make,make install的作用" rel="bookmark">configure,make,make install的作用</a></h4>  </header>                </div>
              </article>
            </div>
                      <div class="col-6 col-sm-3 col-md-3 mt-10 mb-10">
              <article class="post">
                  <div class="entry-media">
    <div class="placeholder" style="padding-bottom: 66.666666666667%;">
      <a target="_blank" href="https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html">
        <img class="lazyload" data-src="https://blog.lixypro.com/wp-content/themes/ripro/timthumb.php?src=https://blog.lixypro.com/wp-content/themes/ripro/assets/images/thumb/1.jpg&#038;h=200&#038;w=300&#038;zc=1&#038;a=c&#038;q=100&#038;s=1" src="" alt="Linux环境变量配置方法详解">  
      </a>
            <div class="cao-cover">
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript><img src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" width="50" height="50px"></noscript>
</noscript>
</noscript>
</noscript>
</div>
          </div>
      </div>
                  <div class="entry-wrapper">
                  
  <header class="entry-header">    
    <h4 class="entry-title"><a target="_blank" href="https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html" title="Linux环境变量配置方法详解" rel="bookmark">Linux环境变量配置方法详解</a></h4>  </header>                </div>
              </article>
            </div>
                      <div class="col-6 col-sm-3 col-md-3 mt-10 mb-10">
              <article class="post">
                  <div class="entry-media">
    <div class="placeholder" style="padding-bottom: 66.666666666667%;">
      <a target="_blank" href="https://blog.lixypro.com/houduanyunwei/detailed_explanation_of_the_process_of_compiling_and_installing_apache_on_centos_server_source_package.html">
        <img class="lazyload" data-src="https://blog.lixypro.com/wp-content/themes/ripro/timthumb.php?src=https://blog.lixypro.com/wp-content/themes/ripro/assets/images/thumb/1.jpg&#038;h=200&#038;w=300&#038;zc=1&#038;a=c&#038;q=100&#038;s=1" src="" alt="Centos服务器源码包编译安装Apache过程详解">  
      </a>
            <div class="cao-cover">
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript><img src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" width="50" height="50px"></noscript>
</noscript>
</noscript>
</noscript>
</div>
          </div>
      </div>
                  <div class="entry-wrapper">
                  
  <header class="entry-header">    
    <h4 class="entry-title"><a target="_blank" href="https://blog.lixypro.com/houduanyunwei/detailed_explanation_of_the_process_of_compiling_and_installing_apache_on_centos_server_source_package.html" title="Centos服务器源码包编译安装Apache过程详解" rel="bookmark">Centos服务器源码包编译安装Apache过程详解</a></h4>  </header>                </div>
              </article>
            </div>
                      <div class="col-6 col-sm-3 col-md-3 mt-10 mb-10">
              <article class="post">
                  <div class="entry-media">
    <div class="placeholder" style="padding-bottom: 66.666666666667%;">
      <a target="_blank" href="https://blog.lixypro.com/houduanyunwei/linux-centos-install-nginx1-8-1-through-source-package.html">
        <img class="lazyload" data-src="https://blog.lixypro.com/wp-content/themes/ripro/timthumb.php?src=https://blog.lixypro.com/wp-content/uploads/2021/04/1618139383-73898d7f1ddbfbf.jpg&#038;h=200&#038;w=300&#038;zc=1&#038;a=c&#038;q=100&#038;s=1" src="" alt="Linux(centos)通过源码包方式安装nginx1.8.1">  
      </a>
            <div class="cao-cover">
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript><img src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" width="50" height="50px"></noscript>
</noscript>
</noscript>
</noscript>
</div>
          </div>
      </div>
                  <div class="entry-wrapper">
                  
  <header class="entry-header">    
    <h4 class="entry-title"><a target="_blank" href="https://blog.lixypro.com/houduanyunwei/linux-centos-install-nginx1-8-1-through-source-package.html" title="Linux(centos)通过源码包方式安装nginx1.8.1" rel="bookmark">Linux(centos)通过源码包方式安装nginx1.8.1</a></h4>  </header>                </div>
              </article>
            </div>
                  </div>
      </div>
    
  

<div class="bottom-area">
    <div id="comments" class="comments-area">
        
        
        
        	<div id="respond" class="comment-respond">
		<h3 id="reply-title" class="comment-reply-title">发表评论 <small><a rel="nofollow" id="cancel-comment-reply-link" href="https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html#respond" style="display:none;">取消回复</a></small>
</h3>
<form action="https://blog.lixypro.com/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate>
<p class="comment-form-comment"><textarea id="comment" name="comment" rows="8" aria-required="true"></textarea></p>
<div class="row comment-author-inputs">
<div class="col-md-4 input"><p class="comment-form-author"><label for="author">昵称*</label><input id="author" name="author" type="text" value="" size="30" aria-required="true"></p></div>
<div class="col-md-4 input"><p class="comment-form-email"><label for="email">E-mail*</label><input id="email" name="email" type="text" value="" size="30" aria-required="true"></p></div>
<div class="col-md-4 input"><p class="comment-form-url"><label for="url">网站</label><input id="url" name="url" type="text" value="" size="30"></p></div>
</div>
<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"> <label for="wp-comment-cookies-consent">下次发表评论时，请在此浏览器中保存我的姓名、电子邮件和网站</label></p>
<p class="form-submit"><input name="submit" type="submit" id="submit" class="button" value="发表评论"> <input type="hidden" name="comment_post_ID" value="24" id="comment_post_ID">
<input type="hidden" name="comment_parent" id="comment_parent" value="0">
</p>
</form>	</div>
<!-- #respond -->
	    </div>
</div>				</main>
			</div>
		</div>
			</div>
</div>


</div>
<!-- end sitecoent --> 

	
	<div class="module parallax">
		<img class="jarallax-img lazyload" data-srcset="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/background/bg-1.jpg" data-sizes="auto" src="" alt="">
		<div class="container">
			<h4 class="entry-title">
				提供最优质的资源集合			</h4>
							<a target="_blank" class="button" href="https://blog.lixypro.com/">立即查看</a>
										<a target="_blank" class="button transparent" href="https://blog.lixypro.com/">了解详情</a>
					</div>
	</div>
	
	<footer class="site-footer">
		<div class="container">
			
			<div class="footer-widget">
    <div class="row">
        <div class="col-xs-12 col-sm-6 col-md-3 widget--about">
            <div class="widget--content">
                <div class="footer--logo mb-20">
                    <img data-dark="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" alt="Lixypro博客" data-src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" class="tap-logo lazyload" src=""><noscript><img class="tap-logo" src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" data-dark="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" alt="Lixypro博客"></noscript>
                </div>
                <p class="mb-10">Lixypro博客网站,专注于各种技术类.</p>
            </div>
        </div>
        <!-- .col-md-2 end -->
        <div class="col-xs-12 col-sm-3 col-md-2 col-md-offset-1 widget--links">
            <div class="widget--title">
                <h5>本站导航</h5>
            </div>
            <div class="widget--content">
                <ul class="list-unstyled mb-0">
                                    </ul>
            </div>
        </div>
        <!-- .col-md-2 end -->
        <div class="col-xs-12 col-sm-3 col-md-2 widget--links">
            <div class="widget--title">
                <h5>友情链接</h5>
            </div>
            <div class="widget--content">
                <ul class="list-unstyled mb-0">
                    <li><a target="_blank" href="https://www.baidu.com/">百度一下</a></li>
<li><a target="_blank" href="https://www.zhihu.com/">知乎官网</a></li>                </ul>
            </div>
        </div>
        <!-- .col-md-2 end -->
        <div class="col-xs-12 col-sm-12 col-md-4 widget--newsletter">
            <div class="widget--title">
                <h5>快速搜索</h5>
            </div>
            <div class="widget--content">
                <form class="newsletter--form mb-30" action="https://blog.lixypro.com/" method="get">
                    <input type="text" class="form-control" name="s" placeholder="关键词">
                    <button type="submit"><i class="fa fa-arrow-right"></i></button>
                </form>
                <h6>本站由WordPress程序强力驱动</h6>
            </div>
        </div>

    </div>
</div>						  <div class="site-info">
			    © 2021 Lixypro博客 & WordPress Theme. All rights reserved			    			  </div>
					</div>
	</footer>
	
<div class="rollbar">
	
	<div class="rollbar-item" etap="to_full" title="全屏页面"><i class="fa fa-arrows-alt"></i></div>

	
		<div class="rollbar-item" etap="to_top" title="返回顶部"><i class="fa fa-angle-up"></i></div>
</div>

<div class="dimmer"></div>



<div class="off-canvas">
  <div class="canvas-close"><i class="mdi mdi-close"></i></div>
  <div class="logo-wrapper">
      <a href="https://blog.lixypro.com/">
      <img alt="Lixypro博客" data-src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" class="logo regular lazyload" src=""><noscript><img class="logo regular" src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" alt="Lixypro博客"></noscript>
    </a>
    </div>
  <div class="mobile-menu hidden-lg hidden-xl"></div>
  <aside class="widget-area">
      </aside>
</div>
<script>
    console.log("\n %c RiPro V7.1.0 %c https://blog.lixypro.com \n\n", "color: #fadfa3; background: #030307; padding:5px 0;", "background: #fadfa3; padding:5px 0;");
    console.log("SQL 请求数：66");
    console.log("页面生成耗时： 0.32594");
</script>



<script type="text/javascript" id="toc-front-js-extra">
/* <![CDATA[ */
var tocplus = {"visibility_show":"show","visibility_hide":"hide","width":"Auto"};
/* ]]> */
</script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/plugins/table-of-contents-plus/front.min.js?ver=2002" id="toc-front-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/jQuery/jquery.min.js?ver=10.2.1" id="jQuery-CDN-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/KaTeX/katex.min.js?ver=10.2.1" id="Katex-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/ClipBoard/clipboard.min.js?ver=2.0.1" id="copy-clipboard-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/components/prism-core.min.js?ver=1.15.0" id="prism-core-js-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/autoloader/prism-autoloader.min.js?ver=1.15.0" id="prism-plugin-autoloader-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/toolbar/prism-toolbar.min.js?ver=1.15.0" id="prism-plugin-toolbar-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/line-numbers/prism-line-numbers.min.js?ver=1.15.0" id="prism-plugin-line-numbers-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/show-language/prism-show-language.min.js?ver=1.15.0" id="prism-plugin-show-language-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js?ver=1.15.0" id="prism-plugin-copy-to-clipboard-js"></script>
<script type="text/javascript" id="Front_Style-js-extra">
/* <![CDATA[ */
var FrontStyle = {"openLinkInNewTab":"on"};
/* ]]> */
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/FrontStyle/frontstyle.min.js?ver=10.2.1" id="Front_Style-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/plugins/wp-smushit/app/assets/js/smush-lazy-load.min.js?ver=3.8.4" id="smush-lazy-load-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/plugins.js?ver=7.1.0" id="plugins-js"></script>
<script type="text/javascript" id="app-js-extra">
/* <![CDATA[ */
var caozhuti = {"site_name":"Lixypro博客","home_url":"https:\/\/blog.lixypro.com","ajaxurl":"https:\/\/blog.lixypro.com\/wp-admin\/admin-ajax.php","is_singular":"1","tencent_captcha":{"is":"","appid":""},"infinite_load":"加载更多","infinite_loading":"<i class=\"fa fa-spinner fa-spin\"><\/i> 加载中...","site_notice":{"is":"0","color":"rgb(33, 150, 243)","html":"<div class=\"notify-content\"><h3>Lixypro欢迎你!<\/h3><div>这是一条网站公告，可在后台开启或关闭，可自定义背景颜色，标题，内容，用户首次打开关闭后不再重复弹出，此处可使用html标签...<\/div><\/div>"},"pay_type_html":{"html":"<div class=\"pay-button-box\"><\/div><p style=\"font-size: 13px; padding: 0; margin: 0;\">免费或钻石免费资源仅限余额支付<\/p>","alipay":0,"weixinpay":0}};
/* ]]> */
</script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/app.js?ver=7.1.0" id="app-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/plugins/jquery.fancybox.min.js?ver=7.1.0" id="fancybox-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-includes/js/comment-reply.min.js?ver=5.7" id="comment-reply-js"></script>
        <script type="text/javascript">
            (function ($) {
                $(document).ready(function () {
                    $(".katex.math.inline").each(function () {
                        var parent = $(this).parent()[0];
                        if (parent.localName !== "code") {
                            var texTxt = $(this).text();
                            var el = $(this).get(0);
                            try {
                                katex.render(texTxt, el);
                            } catch (err) {
                                $(this).html("<span class=\"err\">" + err);
                            }
                        } else {
                            $(this).parent().text($(this).parent().text());
                        }
                    });
                    $(".katex.math.multi-line").each(function () {
                        var texTxt = $(this).text();
                        var el = $(this).get(0);
                        try {
                            katex.render(texTxt, el, {displayMode: true})
                        } catch (err) {
                            $(this).html("<span class=\"err\">" + err)
                        }
                    });
                })
            })(jQuery);
        </script>
                <script type="text/javascript">
            Prism.plugins.autoloader.languages_path = "https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/components/";
        </script>
        
</div>
</body>
</html>